faApp.controller('SaleconListCtrl',['$scope','licaishiManagerService','caleconService','exportService','$location','$controller','$route', '$filter', function($scope,licaishiManagerService,caleconService,exportService,$location,$controller,$route, $filter) {
  $controller('BaseListCtrl', {
    $scope: $scope
  });
  var nowTime = new Date();
  var year = nowTime.getFullYear();
  var month = nowTime.getMonth()+1;
  var month = month > 9 ? month : '0' + month;
  var day = nowTime.getDate() > 9 ? nowTime.getDate() : '0' + nowTime.getDate();
  nowTime = year +'-'+ month +'-'+ day;

  $scope.searchMap = {
    dateStart:nowTime,
    dateEnd : nowTime
  }
  $scope.config = {
    pageSize : 20,
    pageNo : 1,
    dateStart : $scope.searchMap.dateStart,
    dateEnd : $scope.searchMap.dateEnd,
  }

  $scope.config1={"pageSize" : 10000}
  licaishiManagerService.list($scope.config1).then(function(json){
    if (json.statusCode){
      alert("出错了:" + json.statusCode);
    }else{
      $scope.licaishiManagerUserList = json.list;
    }
  });

  $scope.$watch('config',function(json){
    caleconService.getDataList($scope.config).then(function(json){
      if(json.statusCode){
        alert("出错了：+json.statusCode");
      }else{
        $scope.list = json.list;
      }
    })

  },true)

  $scope.export = function(){
    exportService.exportCSV($scope.config,"USER_SAlECON_CVS");
  };

}]);



